import 'package:my_flutter_core/utils/format_utils.dart';

class MethodCallback {
  MethodCallback({required this.callbackName, this.paramNames});

  String callbackName;
  List<String>? paramNames;

  factory MethodCallback.fromJson(Map<String, dynamic> json) {
    return MethodCallback(
      callbackName: json['callbackName'].toString(),
      paramNames: tryToConvert<List<String>>(
        json['paramNames'],
        (p) => List<String>.from(p),
      ),
    );
  }
}
